home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / MacTCP.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  20.9 KB  |  764 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        MacTCP.mod
  3.  
  4.      Contains:    TCP Manager Interfaces.
  5.  
  6.      Version:    Technology:    MacTCP 2.0.6
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE MacTCP;
  23.  
  24. IMPORT SYSTEM, Types, OSUtils, AppleTalk;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29. (*
  30. Developer Notes*:
  31.         0. This MacTCP header replaces what used to be defined in the following header files
  32.             MacTCPCommonTypes.h
  33.             GetMyIPAddr.h
  34.             MiscIPPB.h
  35.             TCPPB.h
  36.             UDPPB.h 
  37.             
  38.             When the various control calls are made to the ip driver, you must set up a 
  39.             NewRoutineDescriptor for every non-nil completion routine and/or notifyProc parameter.  
  40.             Otherwise, the 68K driver code, will not correctly call your routine.
  41.         1. For ipctlGetAddr Control calls, use NewGetIPIOCompletionProc
  42.             to set up a GetIPIOCompletionUPP universal procptr to pass as
  43.             the ioCompletion parameter.
  44.         2. For the ipctlEchoICMP and ipctlLAPStats Control calls, use 
  45.             NewIPIOCompletion to set up a IPIOCompletionUPP universal procptr
  46.             to pass in the ioCompletion field of the parameter block.
  47.         3. For TCPCreatePB Control calls, use NewTCPNotifyProc to set up a
  48.             TCPNotifyUPP universal procptr to pass in the notifyProc field
  49.             of the parameter block
  50.         4. For all of the TCP Control calls using the TCPiopb parameter block,
  51.             use NewTCPIOCompletionProc to set up a TCPIOCompletionUPP
  52.             universal procptr to pass in the ioCompletion field of the paramter
  53.             block.
  54.         5. For UDBCreatePB Control calls, use NewUDPNotifyProc to set up a
  55.             UDPNotifyUPP universal procptr to pass in the notifyProc field
  56.             of the parameter block
  57.         6. For all of the UDP Control calls using the UDPiopb parameter block,
  58.             use NewUDPIOCompletionProc to set up a UDPIOCompletionUPP
  59.             universal procptr to pass in the ioCompletion field of the paramter
  60.             block.
  61.         7. For all calls implementing a notifyProc or ioCompletion routine
  62.             which was set up using a NewTCPRoutineProc call, do not call
  63.             DisposeRoutineSDescriptor on the universal procptr until
  64.             after the completion or notify proc has completed.
  65. *)
  66. (* MacTCP return Codes in the range -23000 through -23049 *)
  67.  
  68. CONST
  69.     inProgress*                    = 1;                            (* I/O in progress *)
  70.     ipBadLapErr*                    = -23000;                        (* bad network configuration *)
  71.     ipBadCnfgErr*                = -23001;                        (* bad IP configuration error *)
  72.     ipNoCnfgErr*                    = -23002;                        (* missing IP or LAP configuration error *)
  73.     ipLoadErr*                    = -23003;                        (* error in MacTCP load *)
  74.     ipBadAddr*                    = -23004;                        (* error in getting address *)
  75.     connectionClosing*            = -23005;                        (* connection is closing *)
  76.     invalidLength*                = -23006;
  77.     connectionExists*            = -23007;                        (* request conflicts with existing connection *)
  78.     connectionDoesntExist*        = -23008;                        (* connection does not exist *)
  79.     insufficientResources*        = -23009;                        (* insufficient resources to perform request *)
  80.     invalidStreamPtr*            = -23010;
  81.     streamAlreadyOpen*            = -23011;
  82.     connectionTerminated*        = -23012;
  83.     invalidBufPtr*                = -23013;
  84.     invalidRDS*                    = -23014;
  85.     invalidWDS*                    = -23014;
  86.     openFailed*                    = -23015;
  87.     commandTimeout*                = -23016;
  88.     duplicateSocket*                = -23017;
  89.  
  90. (* Error codes from internal IP functions *)
  91.     ipDontFragErr*                = -23032;                        (* Packet too large to send w/o fragmenting *)
  92.     ipDestDeadErr*                = -23033;                        (* destination not responding *)
  93.     icmpEchoTimeoutErr*            = -23035;                        (* ICMP echo timed-out *)
  94.     ipNoFragMemErr*                = -23036;                        (* no memory to send fragmented pkt *)
  95.     ipRouteErr*                    = -23037;                        (* can't route packet off-net *)
  96.     nameSyntaxErr*                = -23041;
  97.     cacheFault*                    = -23042;
  98.     noResultProc*                = -23043;
  99.     noNameServer*                = -23044;
  100.     authNameErr*                    = -23045;
  101.     noAnsErr*                    = -23046;
  102.     dnrErr*                        = -23047;
  103.     outOfMemory*                    = -23048;
  104.  
  105.     BYTES_16WORD*                = 2;                            (* bytes per* = 16, bit ip word *)
  106.     BYTES_32WORD*                = 4;                            (* bytes per* = 32, bit ip word *)
  107.     BYTES_64WORD*                = 8;                            (* bytes per* = 64, bit ip word *)
  108.  
  109. (* 8-bit quantity *)
  110.     
  111. TYPE
  112.     b_8* = Types.UInt8;
  113.  
  114. (* 16-bit quantity *)
  115.     b_16* = Types.UInt16;
  116.  
  117. (* 32-bit quantity *)
  118.     b_32* = Types.UInt32;
  119.  
  120. (* IP address is 32-bits *)
  121.     ip_addr* = b_32;
  122.  
  123.     ip_addrbytes* = RECORD
  124.         (*ΔΔ CASE INTEGER OF
  125.         0: (
  126.             addr*:                        b_32;
  127.            );
  128.         1: ( *)
  129.             byte*:                        (*ΔΔPACKEDΔΔ*) ARRAY 4 (*ΔΔ[0..3]ΔΔ*) OF Types.SInt8; (* UInt8 *)
  130.            (*ΔΔ );*)
  131.  
  132.     END;
  133.  
  134.     wdsEntry* = RECORD
  135.         length*:                    INTEGER;                                (* length of buffer *)
  136.         ptr*:                    Types.Ptr;                                    (* pointer to buffer *)
  137.     END;
  138.  
  139.     rdsEntry* = RECORD
  140.         length*:                    INTEGER;                                (* length of buffer *)
  141.         ptr*:                    Types.Ptr;                                    (* pointer to buffer *)
  142.     END;
  143.  
  144.     BufferPtr* = LONGINT;
  145.  
  146.     StreamPtr* = LONGINT;
  147.  
  148.  
  149. CONST
  150.     netUnreach*                    = 0;
  151.     hostUnreach*                    = 1;
  152.     protocolUnreach*                = 2;
  153.     portUnreach*                    = 3;
  154.     fragReqd*                    = 4;
  155.     sourceRouteFailed*            = 5;
  156.     timeExceeded*                = 6;
  157.     parmProblem*                    = 7;
  158.     missingOption*                = 8;
  159.     lastICMPMsgType*                = 32767;
  160.  
  161.     
  162. TYPE
  163.     ICMPMsgType* = INTEGER;
  164.  
  165.     ip_port* = b_16;
  166.  
  167.     ICMPReport* = RECORD
  168.         streamPtr*:                StreamPtr;
  169.         localHost*:                ip_addr;
  170.         localPort*:                ip_port;
  171.         remoteHost*:                ip_addr;
  172.         remotePort*:                ip_port;
  173.         reportType*:                INTEGER;
  174.         optionalAddlInfo*:        INTEGER;
  175.         optionalAddlInfoPtr*:    LONGINT;
  176.     END;
  177.  
  178. (* csCode to get our IP address *)
  179.  
  180. CONST
  181.     ipctlGetAddr*                = 15;
  182.  
  183. TYPE
  184.     GetIPIOCompletionUPP* = Types.UniversalProcPtr;
  185.  
  186.     GetAddrParamBlock* = RECORD
  187.         qLink*:                    OSUtils.QElemPtr (*ΔΔ POINTER TO OSUtils.QElem*);
  188.         qType*:                    INTEGER;
  189.         ioTrap*:                    INTEGER;
  190.         ioCmdAddr*:                Types.Ptr;
  191.         ioCompletion*:            GetIPIOCompletionUPP;
  192.         ioResult*:                Types.OSErr;
  193.         ioNamePtr*:                Types.StringPtr;
  194.         ioVRefNum*:                INTEGER;
  195.         ioCRefNum*:                INTEGER;
  196.         csCode*:                    INTEGER;                                (* standard I/O header *)
  197.         ourAddress*:                ip_addr;                                (* our IP address *)
  198.         ourNetMask*:                LONGINT;                                (* our IP net mask *)
  199.     END;
  200.  
  201.     GetIPIOCompletionProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR iopb: GetAddrParamBlock);
  202.  
  203. (* control codes *)
  204.  
  205. CONST
  206.     ipctlEchoICMP*                = 17;                            (* send icmp echo *)
  207.     ipctlLAPStats*                = 19;                            (* get lap stats *)
  208.  
  209. TYPE
  210.     IPIOCompletionUPP* = Types.UniversalProcPtr;
  211.  
  212.     ICMPParamBlock* = RECORD
  213.         qLink*:                    OSUtils.QElemPtr (*ΔΔ POINTER TO OSUtils.QElem*);
  214.         qType*:                    INTEGER;
  215.         ioTrap*:                    INTEGER;
  216.         ioCmdAddr*:                Types.Ptr;
  217.         ioCompletion*:            IPIOCompletionUPP;
  218.         ioResult*:                Types.OSErr;
  219.         ioNamePtr*:                Types.StringPtr;
  220.         ioVRefNum*:                INTEGER;
  221.         ioCRefNum*:                INTEGER;
  222.         csCode*:                    INTEGER;                                (* standard I/O header *)
  223.         params*:                    ARRAY 11 (*ΔΔ[0..10]ΔΔ*) OF INTEGER;
  224.         icmpEchoInfo*:            RECORD
  225.                 echoRequestOut*:                    LONGINT;                        (* time in ticks of when the echo request went out *)
  226.                 echoReplyIn*:                    LONGINT;                        (* time in ticks of when the reply was received *)
  227.                 echoedData*:                        rdsEntry;                        (* data received in responce *)
  228.                 options*:                        Types.Ptr;
  229.                 userDataPtr*:                    LONGINT;
  230.             END;
  231.  
  232.  
  233.     END;
  234.  
  235.     IPIOCompletionProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR iopb: ICMPParamBlock);
  236.  
  237.     ICMPEchoNotifyProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR iopb: ICMPParamBlock);
  238.     ICMPEchoNotifyUPP* = Types.UniversalProcPtr;
  239.  
  240.     IPParamBlock* = RECORD
  241.         qLink*:                    POINTER TO OSUtils.QElem;
  242.         qType*:                    INTEGER;
  243.         ioTrap*:                    INTEGER;
  244.         ioCmdAddr*:                Types.Ptr;
  245.         ioCompletion*:            IPIOCompletionUPP;
  246.         ioResult*:                Types.OSErr;
  247.         ioNamePtr*:                Types.StringPtr;
  248.         ioVRefNum*:                INTEGER;
  249.         ioCRefNum*:                INTEGER;
  250.         csCode*:                    INTEGER;                                (* standard I/O header *)
  251.         (*ΔΔ CASE INTEGER OF
  252.         0: ( *)
  253.             dest*:                        ip_addr;                            (* echo to IP address *)
  254.             data*:                        wdsEntry;
  255.             timeout*:                    INTEGER;
  256.             options*:                    Types.Ptr;
  257.             optLength*:                    INTEGER;
  258.             icmpCompletion*:                ICMPEchoNotifyUPP;
  259.             userDataPtr*:                LONGINT;
  260.            (*ΔΔ );
  261.         1: (
  262.             lapStatsPtr*:                POINTER TO LAPStats;
  263.            );*)
  264.  
  265.     END;
  266.  
  267.     nbp_entry* = RECORD
  268.         ip_address*:                ip_addr;                                (* IP address *)
  269.         at_address*:                AppleTalk.AddrBlock;                                (* matching AppleTalk address *)
  270.         gateway*:                BOOLEAN;                                (* TRUE if entry for a gateway *)
  271.         valid*:                    BOOLEAN;                                (* TRUE if LAP address is valid *)
  272.         probing*:                BOOLEAN;                                (* TRUE if NBP lookup pending *)
  273.         afiller*:                Types.SInt8;                                    (* Filler for proper byte alignment     *)
  274.         age*:                    LONGINT;                                (* ticks since cache entry verified *)
  275.         access*:                    LONGINT;                                (* ticks since last access *)
  276.         filler*:                    ARRAY 116 (*ΔΔ[0..115]ΔΔ*) OF Types.SInt8;                (* for internal use only !!! *)
  277.     END;
  278.  
  279.     Enet_addr* = RECORD
  280.         en_hi*:                    b_16;
  281.         en_lo*:                    b_32;
  282.     END;
  283.  
  284.     arp_entry* = RECORD
  285.         age*:                    INTEGER;                                (* cache aging field *)
  286.         protocol*:                b_16;                                    (* Protocol type *)
  287.         ip_address*:                ip_addr;                                (* IP address *)
  288.         en_address*:                Enet_addr;                                (* matching Ethernet address *)
  289.     END;
  290.  
  291.     LAPStatsAddrXlation* = RECORD
  292.         (*ΔΔ CASE INTEGER OF
  293.         0: ( *)
  294.             arp_table*:                    POINTER TO arp_entry;
  295.            (*ΔΔ );
  296.         1: (
  297.             nbp_table*:                    POINTER TO nbp_entry;
  298.            );*)
  299.     END;
  300.  
  301.     LAPStats* = RECORD
  302.         ifType*:                    INTEGER;
  303.         ifString*:                SYSTEM.PTR (*ΔΔ POINTER TO CHAR*);
  304.         ifMaxMTU*:                INTEGER;
  305.         ifSpeed*:                LONGINT;
  306.         ifPhyAddrLength*:        INTEGER;
  307.         ifPhysicalAddress*:        SYSTEM.PTR (*ΔΔ POINTER TO CHAR*);
  308.         AddrXlation*:            LAPStatsAddrXlation;
  309.         slotNumber*:                INTEGER;
  310.     END;
  311.  
  312. (* number of ARP table entries *)
  313.  
  314. CONST
  315.     ARP_TABLE_SIZE*                = 20;
  316.  
  317.     NBP_TABLE_SIZE*                = 20;                            (* number of NBP table entries *)
  318.     NBP_MAX_NAME_SIZE*            = 16 + 10 + 2;
  319.  
  320. (* Command codes *)
  321.     TCPCreate*                    = 30;
  322.     TCPPassiveOpen*                = 31;
  323.     TCPActiveOpen*                = 32;
  324.     TCPSend*                        = 34;
  325.     TCPNoCopyRcv*                = 35;
  326.     TCPRcvBfrReturn*                = 36;
  327.     TCPRcv*                        = 37;
  328.     TCPClose*                    = 38;
  329.     TCPAbort*                    = 39;
  330.     TCPStatus*                    = 40;
  331.     TCPExtendedStat*                = 41;
  332.     TCPRelease*                    = 42;
  333.     TCPGlobalInfo*                = 43;
  334.     TCPCtlMax*                    = 49;
  335.  
  336.     TCPClosing*                    = 1;
  337.     TCPULPTimeout*                = 2;
  338.     TCPTerminate*                = 3;
  339.     TCPDataArrival*                = 4;
  340.     TCPUrgent*                    = 5;
  341.     TCPICMPReceived*                = 6;
  342.     lastEvent*                    = 32767;
  343.  
  344.     
  345. TYPE
  346.     TCPEventCode* = INTEGER;
  347.  
  348.  
  349. CONST
  350.     TCPRemoteAbort*                = 2;
  351.     TCPNetworkFailure*            = 3;
  352.     TCPSecPrecMismatch*            = 4;
  353.     TCPULPTimeoutTerminate*        = 5;
  354.     TCPULPAbort*                    = 6;
  355.     TCPULPClose*                    = 7;
  356.     TCPServiceError*                = 8;
  357.     lastReason*                    = 32767;
  358.  
  359.     
  360. TYPE
  361.     TCPTerminationReason* = INTEGER;
  362.  
  363.     TCPNotifyProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (tcpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Types.Ptr; terminReason: INTEGER; VAR icmpMsg: ICMPReport);
  364.     TCPNotifyUPP* = Types.UniversalProcPtr;
  365.  
  366.     tcp_port* = INTEGER;
  367.  
  368. (* ValidityFlags *)
  369.  
  370. CONST
  371.     timeoutValue*                = $80;
  372.     timeoutAction*                = $40;
  373.     typeOfService*                = $20;
  374.     precedence*                    = $10;
  375.  
  376. (* TOSFlags *)
  377.     lowDelay*                    = $01;
  378.     throughPut*                    = $02;
  379.     reliability*                    = $04;
  380.  
  381.  
  382. TYPE
  383.     TCPIOCompletionUPP* = Types.UniversalProcPtr;
  384.  
  385.     TCPiopb* = RECORD
  386.         fill12*:                    ARRAY 12 (*ΔΔ[0..11]ΔΔ*) OF Types.SInt8;
  387.         ioCompletion*:            TCPIOCompletionUPP;
  388.         ioResult*:                INTEGER;
  389.         ioNamePtr*:                Types.Ptr;
  390.         ioVRefNum*:                INTEGER;
  391.         ioCRefNum*:                INTEGER;
  392.         csCode*:                    INTEGER;
  393.         tcpStream*:                StreamPtr;
  394.         (*ΔΔ CASE INTEGER OF
  395.         0: (
  396.             create*:                        TCPCreatePB;
  397.            );
  398.         1: (
  399.             open*:                        TCPOpenPB;
  400.            );
  401.         2: (
  402.             send*:                        TCPSendPB;
  403.            );
  404.         3: (
  405.             receive*:                    TCPReceivePB;
  406.            );
  407.         4: (
  408.             close*:                        TCPClosePB;
  409.            );
  410.         5: (
  411.             abort*:                        TCPAbortPB;
  412.            );
  413.         6: (
  414.             status*:                        TCPStatusPB;
  415.            );
  416.         7: (
  417.             globalInfo*:                    TCPGlobalInfoPB;
  418.            );*)
  419.     END;
  420.  
  421.     TCPIOCompletionProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR iopb: TCPiopb);
  422.  
  423.     TCPCreatePB* = RECORD(TCPiopb)
  424.         rcvBuff*:                Types.Ptr;
  425.         rcvBuffLen*:                LONGINT;
  426.         notifyProc*:                TCPNotifyUPP;
  427.         userDataPtr*:            Types.Ptr;
  428.     END;
  429.  
  430.     TCPOpenPB* = RECORD(TCPiopb)
  431.         ulpTimeoutValue*:        Types.SInt8;
  432.         ulpTimeoutAction*:        Types.SInt8;
  433.         validityFlags*:            Types.SInt8;
  434.         commandTimeoutValue*:    Types.SInt8;
  435.         remoteHost*:                ip_addr;
  436.         remotePort*:                tcp_port;
  437.         localHost*:                ip_addr;
  438.         localPort*:                tcp_port;
  439.         tosFlags*:                Types.SInt8;
  440.         precedence*:                Types.SInt8;
  441.         dontFrag*:                BOOLEAN;
  442.         timeToLive*:                Types.SInt8;
  443.         security*:                Types.SInt8;
  444.         optionCnt*:                Types.SInt8;
  445.         options*:                ARRAY 40 (*ΔΔ[0..39]ΔΔ*) OF Types.SInt8;
  446.         userDataPtr*:            Types.Ptr;
  447.     END;
  448.  
  449.     TCPSendPB* = RECORD(TCPiopb)
  450.         ulpTimeoutValue*:        Types.SInt8;
  451.         ulpTimeoutAction*:        Types.SInt8;
  452.         validityFlags*:            Types.SInt8;
  453.         pushFlag*:                BOOLEAN;
  454.         urgentFlag*:                BOOLEAN;
  455.         filler*:                    Types.SInt8;                                    (* Filler for proper byte alignment     *)
  456.         wdsPtr*:                    Types.Ptr;
  457.         sendFree*:                LONGINT;
  458.         sendLength*:                INTEGER;
  459.         userDataPtr*:            Types.Ptr;
  460.     END;
  461.  
  462. (* for receive and return rcv buff calls *)
  463. (*   Note*: the filler in the following structure is in a different location than *)
  464. (*         that specified in the Programmer's Guide.  *)
  465.     TCPReceivePB* = RECORD(TCPiopb)
  466.         commandTimeoutValue*:    Types.SInt8;
  467.         markFlag*:                BOOLEAN;
  468.         urgentFlag*:                BOOLEAN;
  469.         filler*:                    Types.SInt8;                                    (* Filler for proper byte alignment  *)
  470.         rcvBuff*:                Types.Ptr;
  471.         rcvBuffLen*:                INTEGER;
  472.         rdsPtr*:                    Types.Ptr;
  473.         rdsLength*:                INTEGER;
  474.         secondTimeStamp*:        INTEGER;
  475.         userDataPtr*:            Types.Ptr;
  476.     END;
  477.  
  478.     TCPClosePB* = RECORD(TCPiopb)
  479.         ulpTimeoutValue*:        Types.SInt8;
  480.         ulpTimeoutAction*:        Types.SInt8;
  481.         validityFlags*:            Types.SInt8;
  482.         filler*:                    Types.SInt8;                                    (* Filler for proper byte alignment     *)
  483.         userDataPtr*:            Types.Ptr;
  484.     END;
  485.  
  486.     HistoBucket* = RECORD
  487.         value*:                    INTEGER;
  488.         counter*:                LONGINT;
  489.     END;
  490.  
  491.  
  492. CONST
  493.     NumOfHistoBuckets*            = 7;
  494.  
  495.  
  496. TYPE
  497.     TCPConnectionStats* = RECORD
  498.         dataPktsRcvd*:            LONGINT;
  499.         dataPktsSent*:            LONGINT;
  500.         dataPktsResent*:            LONGINT;
  501.         bytesRcvd*:                LONGINT;
  502.         bytesRcvdDup*:            LONGINT;
  503.         bytesRcvdPastWindow*:    LONGINT;
  504.         bytesSent*:                LONGINT;
  505.         bytesResent*:            LONGINT;
  506.         numHistoBuckets*:        INTEGER;
  507.         sentSizeHisto*:            ARRAY (*ΔΔ[0..*)NumOfHistoBuckets(*ΔΔ -1]ΔΔ*) OF HistoBucket;
  508.         lastRTT*:                INTEGER;
  509.         tmrSRTT*:                INTEGER;
  510.         rttVariance*:            INTEGER;
  511.         tmrRTO*:                    INTEGER;
  512.         sendTries*:                Types.SInt8;
  513.         sourchQuenchRcvd*:        Types.SInt8;
  514.     END;
  515.  
  516.     TCPStatusPB* = RECORD(TCPiopb)
  517.         ulpTimeoutValue*:        Types.SInt8;
  518.         ulpTimeoutAction*:        Types.SInt8;
  519.         unused*:                    LONGINT;
  520.         remoteHost*:                ip_addr;
  521.         remotePort*:                tcp_port;
  522.         localHost*:                ip_addr;
  523.         localPort*:                tcp_port;
  524.         tosFlags*:                Types.SInt8;
  525.         precedence*:                Types.SInt8;
  526.         connectionState*:        Types.SInt8;
  527.         filler*:                    Types.SInt8;                                    (* Filler for proper byte alignment     *)
  528.         sendWindow*:                INTEGER;
  529.         rcvWindow*:                INTEGER;
  530.         amtUnackedData*:            INTEGER;
  531.         amtUnreadData*:            INTEGER;
  532.         securityLevelPtr*:        Types.Ptr;
  533.         sendUnacked*:            LONGINT;
  534.         sendNext*:                LONGINT;
  535.         congestionWindow*:        LONGINT;
  536.         rcvNext*:                LONGINT;
  537.         srtt*:                    LONGINT;
  538.         lastRTT*:                LONGINT;
  539.         sendMaxSegSize*:            LONGINT;
  540.         connStatPtr*:            POINTER TO TCPConnectionStats;
  541.         userDataPtr*:            Types.Ptr;
  542.     END;
  543.  
  544.     TCPAbortPB* = RECORD(TCPiopb)
  545.         userDataPtr*:            Types.Ptr;
  546.     END;
  547.  
  548.     TCPParam* = RECORD
  549.         tcpRtoA*:                LONGINT;
  550.         tcpRtoMin*:                LONGINT;
  551.         tcpRtoMax*:                LONGINT;
  552.         tcpMaxSegSize*:            LONGINT;
  553.         tcpMaxConn*:                LONGINT;
  554.         tcpMaxWindow*:            LONGINT;
  555.     END;
  556.  
  557.     TCPStats* = RECORD
  558.         tcpConnAttempts*:        LONGINT;
  559.         tcpConnOpened*:            LONGINT;
  560.         tcpConnAccepted*:        LONGINT;
  561.         tcpConnClosed*:            LONGINT;
  562.         tcpConnAborted*:            LONGINT;
  563.         tcpOctetsIn*:            LONGINT;
  564.         tcpOctetsOut*:            LONGINT;
  565.         tcpOctetsInDup*:            LONGINT;
  566.         tcpOctetsRetrans*:        LONGINT;
  567.         tcpInputPkts*:            LONGINT;
  568.         tcpOutputPkts*:            LONGINT;
  569.         tcpDupPkts*:                LONGINT;
  570.         tcpRetransPkts*:            LONGINT;
  571.     END;
  572.  
  573.     StreamPPtr* = SYSTEM.PTR (*ΔΔ POINTER TO StreamPtr*);
  574.  
  575.     TCPGlobalInfoPB* = RECORD(TCPiopb)
  576.         tcpParamPtr*:            POINTER TO TCPParam;
  577.         tcpStatsPtr*:            POINTER TO TCPStats;
  578.         tcpCDBTable*:            ARRAY 1 (*ΔΔ[0..0]ΔΔ*) OF StreamPPtr;
  579.         userDataPtr*:            Types.Ptr;
  580.         maxTCPConnections*:        INTEGER;
  581.     END;
  582.  
  583.  
  584.  
  585. CONST
  586.     UDPCreate*                    = 20;
  587.     UDPRead*                        = 21;
  588.     UDPBfrReturn*                = 22;
  589.     UDPWrite*                    = 23;
  590.     UDPRelease*                    = 24;
  591.     UDPMaxMTUSize*                = 25;
  592.     UDPStatus*                    = 26;
  593.     UDPMultiCreate*                = 27;
  594.     UDPMultiSend*                = 28;
  595.     UDPMultiRead*                = 29;
  596.     UDPCtlMax*                    = 29;
  597.  
  598.     UDPDataArrival*                = 1;
  599.     UDPICMPReceived*                = 2;
  600.     lastUDPEvent*                = 32767;
  601.  
  602.     
  603. TYPE
  604.     UDPEventCode* = INTEGER;
  605.  
  606.     UDPNotifyProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (udpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Types.Ptr; VAR icmpMsg: ICMPReport);
  607.     UDPNotifyUPP* = Types.UniversalProcPtr;
  608.  
  609.     udp_port* = INTEGER;
  610.  
  611.     UDPIOCompletionUPP* = Types.UniversalProcPtr;
  612.  
  613.     UDPiopb* = RECORD
  614.         fill12*:                    ARRAY 12 (*ΔΔ[0..11]ΔΔ*) OF Types.SInt8;
  615.         ioCompletion*:            UDPIOCompletionUPP;
  616.         ioResult*:                INTEGER;
  617.         ioNamePtr*:                Types.Ptr;
  618.         ioVRefNum*:                INTEGER;
  619.         ioCRefNum*:                INTEGER;
  620.         csCode*:                    INTEGER;
  621.         udpStream*:                StreamPtr;
  622.         (*ΔΔ CASE INTEGER OF
  623.         0: (
  624.             create*:                        UDPCreatePB;
  625.            );
  626.         1: (
  627.             send*:                        UDPSendPB;
  628.            );
  629.         2: (
  630.             receive*:                    UDPReceivePB;
  631.            );
  632.         3: (
  633.             mtu*:                        UDPMTUPB;
  634.            );*)
  635.     END;
  636.  
  637.     UDPIOCompletionProcPtr* = (*ΔΔ Types.ProcPtr;*) PROCEDURE (VAR iopb: UDPiopb);
  638.  
  639. (* for create and release calls *)
  640.     UDPCreatePB* = RECORD(UDPiopb)
  641.         rcvBuff*:                Types.Ptr;
  642.         rcvBuffLen*:                LONGINT;
  643.         notifyProc*:                UDPNotifyUPP;
  644.         localPort*:                INTEGER;
  645.         userDataPtr*:            Types.Ptr;
  646.         endingPort*:                udp_port;
  647.     END;
  648.  
  649.     UDPSendPB* = RECORD(UDPiopb)
  650.         reserved*:                INTEGER;
  651.         remoteHost*:                ip_addr;
  652.         remotePort*:                udp_port;
  653.         wdsPtr*:                    Types.Ptr;
  654.         checkSum*:                BOOLEAN;
  655.         filler*:                    Types.SInt8;                                    (* Filler for proper byte alignment     *)
  656.         sendLength*:                INTEGER;
  657.         userDataPtr*:            Types.Ptr;
  658.         localPort*:                udp_port;
  659.     END;
  660.  
  661. (* for receive and buffer return calls *)
  662.     UDPReceivePB* = RECORD(UDPiopb)
  663.         timeOut*:                INTEGER;
  664.         remoteHost*:                ip_addr;
  665.         remotePort*:                udp_port;
  666.         rcvBuff*:                Types.Ptr;
  667.         rcvBuffLen*:                INTEGER;
  668.         secondTimeStamp*:        INTEGER;
  669.         userDataPtr*:            Types.Ptr;
  670.         destHost*:                ip_addr;                                (* only for use with multi rcv *)
  671.         destPort*:                udp_port;                                (* only for use with multi rcv *)
  672.     END;
  673.  
  674.     UDPMTUPB* = RECORD(UDPiopb)
  675.         mtuSize*:                INTEGER;
  676.         remoteHost*:                ip_addr;
  677.         userDataPtr*:            Types.Ptr;
  678.     END;
  679.  
  680.  
  681. CONST
  682.     uppGetIPIOCompletionProcInfo* = $000000C1; (* PROCEDURE (4 byte param); *)
  683.     uppIPIOCompletionProcInfo* = $000000C1; (* PROCEDURE (4 byte param); *)
  684.     uppICMPEchoNotifyProcInfo* = $000000C0; (* PROCEDURE (4 byte param); *)
  685.     uppTCPNotifyProcInfo* = $0000EEC0; (* PROCEDURE (4 byte param, 2 byte param, 4 byte param, 2 byte param, 4 byte param); *)
  686.     uppTCPIOCompletionProcInfo* = $000000C1; (* PROCEDURE (4 byte param); *)
  687.     uppUDPNotifyProcInfo* = $00003EC0; (* PROCEDURE (4 byte param, 2 byte param, 4 byte param, 4 byte param); *)
  688.     uppUDPIOCompletionProcInfo* = $000000C1; (* PROCEDURE (4 byte param); *)
  689.  
  690. PROCEDURE NewGetIPIOCompletionProc*(userRoutine: GetIPIOCompletionProcPtr): GetIPIOCompletionUPP;
  691.     (*$IF NOT GENERATINGCFM *)
  692.     INLINE PASCAL $2E9F;
  693.     (*$END*)
  694.  
  695. PROCEDURE NewIPIOCompletionProc*(userRoutine: IPIOCompletionProcPtr): IPIOCompletionUPP;
  696.     (*$IF NOT GENERATINGCFM *)
  697.     INLINE PASCAL $2E9F;
  698.     (*$END*)
  699.  
  700. PROCEDURE NewICMPEchoNotifyProc*(userRoutine: ICMPEchoNotifyProcPtr): ICMPEchoNotifyUPP;
  701.     (*$IF NOT GENERATINGCFM *)
  702.     INLINE PASCAL $2E9F;
  703.     (*$END*)
  704.  
  705. PROCEDURE NewTCPNotifyProc*(userRoutine: TCPNotifyProcPtr): TCPNotifyUPP;
  706.     (*$IF NOT GENERATINGCFM *)
  707.     INLINE PASCAL $2E9F;
  708.     (*$END*)
  709.  
  710. PROCEDURE NewTCPIOCompletionProc*(userRoutine: TCPIOCompletionProcPtr): TCPIOCompletionUPP;
  711.     (*$IF NOT GENERATINGCFM *)
  712.     INLINE PASCAL $2E9F;
  713.     (*$END*)
  714.  
  715. PROCEDURE NewUDPNotifyProc*(userRoutine: UDPNotifyProcPtr): UDPNotifyUPP;
  716.     (*$IF NOT GENERATINGCFM *)
  717.     INLINE PASCAL $2E9F;
  718.     (*$END*)
  719.  
  720. PROCEDURE NewUDPIOCompletionProc*(userRoutine: UDPIOCompletionProcPtr): UDPIOCompletionUPP;
  721.     (*$IF NOT GENERATINGCFM *)
  722.     INLINE PASCAL $2E9F;
  723.     (*$END*)
  724.  
  725. PROCEDURE CallGetIPIOCompletionProc*(VAR iopb: GetAddrParamBlock; userRoutine: GetIPIOCompletionUPP);
  726.     (*$IF NOT GENERATINGCFM*)
  727.     INLINE PASCAL $205F, $4E90;
  728.     (*$END*)
  729.  
  730. PROCEDURE CallIPIOCompletionProc*(VAR iopb: ICMPParamBlock; userRoutine: IPIOCompletionUPP);
  731.     (*$IF NOT GENERATINGCFM*)
  732.     INLINE PASCAL $205F, $4E90;
  733.     (*$END*)
  734.  
  735. PROCEDURE CallICMPEchoNotifyProc*(VAR iopb: ICMPParamBlock; userRoutine: ICMPEchoNotifyUPP);
  736.     (*$IF NOT GENERATINGCFM*)
  737.     INLINE PASCAL $205F, $4E90;
  738.     (*$END*)
  739.  
  740. PROCEDURE CallTCPNotifyProc*(tcpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Types.Ptr; terminReason: INTEGER; VAR icmpMsg: ICMPReport; userRoutine: TCPNotifyUPP);
  741.     (*$IF NOT GENERATINGCFM*)
  742.     INLINE PASCAL $205F, $4E90;
  743.     (*$END*)
  744.  
  745. PROCEDURE CallTCPIOCompletionProc*(VAR iopb: TCPiopb; userRoutine: TCPIOCompletionUPP);
  746.     (*$IF NOT GENERATINGCFM*)
  747.     INLINE PASCAL $205F, $4E90;
  748.     (*$END*)
  749.  
  750. PROCEDURE CallUDPNotifyProc*(udpStream: StreamPtr; eventCode: INTEGER; userDataPtr: Types.Ptr; VAR icmpMsg: ICMPReport; userRoutine: UDPNotifyUPP);
  751.     (*$IF NOT GENERATINGCFM*)
  752.     INLINE PASCAL $205F, $4E90;
  753.     (*$END*)
  754.  
  755. PROCEDURE CallUDPIOCompletionProc*(VAR iopb: UDPiopb; userRoutine: UDPIOCompletionUPP);
  756.     (*$IF NOT GENERATINGCFM*)
  757.     INLINE PASCAL $205F, $4E90;
  758.     (*$END*)
  759.  
  760. (* $ALIGN RESET*)
  761. (* $POP*)
  762.  
  763.  END MacTCP.
  764.